home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr26
/
netprog.zip
/
NETPROG.TAR
/
ipc
/
time_pipe.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-12-17
|
394b
|
27 lines
#define COUNT 20000
#define BUFFSIZE 128
char buff[BUFFSIZE];
main()
{
register int i;
int pipefd[2];
if (pipe(pipefd) < 0)
err_sys("pipe error");
for (i = 0; i < COUNT; i++) {
if (write(pipefd[1], buff, BUFFSIZE) < 0)
err_sys("write error");
if (read(pipefd[0], buff, BUFFSIZE) != BUFFSIZE)
err_sys("read error");
}
close(pipefd[0]);
close(pipefd[1]);
exit(0);
}